package com.tidy.seed.admin.system.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;


/**
 * LoginUserDto DTO
 * 描述：
 *
 * @author 59717
 * @date 2025-08-01
 */
@Data
@ApiModel(description = "登录参数")
public class LoginUserDTO {

    @ApiModelProperty(
            value = "用户名",
            required = true, // 直接用boolean表示是否必填
            example = "zhangyang",
            notes = "长度4-20个字符"
    )
    @NotBlank(message = "用户名不能为空")
//    @Email(message = "邮箱格式不正确")
    @Size(min = 4, max = 20, message = "用户名长度必须在4-20个字符之间")
    private String username;

    @ApiModelProperty(
            value = "密码",
            required = true, // 同理，true表示必填
            example = "123456",
            notes = "长度6-20个字符，需包含大小写字母、数字和特殊字符"
    )
    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度必须在6-20个字符之间")
//    @Pattern(
//            regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{6,20}$",
//            message = "密码必须包含大小写字母、数字和特殊字符(@$!%*?&)，长度6-20个字符"
//    )
    private String password;
}
